package com.changgou.pay.config;

import org.springframework.amqp.core.Exchange;
import org.springframework.amqp.core.ExchangeBuilder;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.QueueBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: HuangFu
 * @Date: 2020/2/19 15:23
 * @Description:
 */
@Configuration
public class RabbitMQConfig {

    public final static String EC_PAYNOTIFY = "ec_paynotify";

    public final static String ORDER_PAY = "order_pay";

    @Bean
    public Queue ORDER_PAY(){
        return QueueBuilder.durable(ORDER_PAY).build();
    }

    @Bean(EC_PAYNOTIFY)
    public Exchange EC_PAYNOTIFY(){
        return ExchangeBuilder.fanoutExchange(EC_PAYNOTIFY).build();
    }


}
